package com.donger.business.form.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.donger.business.form.entity.OnlFormHead;
import com.donger.business.form.query.HeadQuery;
import com.donger.business.form.service.OnlFormHeadService;
import com.donger.common.core.utils.Res;
import com.donger.common.core.utils.Result;
import com.donger.common.query.utils.QueryGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 7326
 */
@RestController
@RequestMapping("/online/form/head")
@AllArgsConstructor
@Api(tags = "在线表单开发提供API")
public class HeadController {

    private final OnlFormHeadService onlFormHeadService;


    @GetMapping("/page")
    @ApiOperation(value = "获取在线表单列表")
    public Result page(Page page, HeadQuery headQuery){
        QueryWrapper<OnlFormHead> onlFormHeadQueryWrapper = QueryGenerator.<OnlFormHead>initQueryWrapper(headQuery);
        onlFormHeadService.page(page,onlFormHeadQueryWrapper);
        return Res.ok(page);
    }



}
